Parallel counter and a multiplication logic circuit

ABSTRACT

A parallel counter comprises logic for generating output bits as symmetrical functions of the input bits. The parallel counter can be used in a multiplication circuit. A multiplication circuit is also provided in which an array of combinations of each bit of a binary number with each other bit of another binary number is generated having a reduced form in order to reduce the steps required in array reduction.

[0001] The present invention generally relates to digital electronic devices and more particularly to a digital electronic device performing binary logic. In one aspect the present invention relates to a parallel counter and in another aspect the present invention relates to a multiplication logic circuit for multiplying two binary numbers.

[0002] It is instrumental for many applications to have a block that adds n inputs together. An output of this block is a binary representation of the number of high inputs. Such blocks, called parallel counters (L. Dadda, Some Schemes for Parallel Multipliers, Alta Freq 34: 349-356 (1965); E. E. Swartzlander Jr., Parallel Counters, IEEE Trans. Comput C-22: 1021-1024 (1973)), are used in circuits performing binary multiplication. There are other applications of a parallel counter, for instance, majority-voting decoders or RSA encoders and decoders. It is important to have an implementation of a parallel counter that achieves a maximal speed. It is known to use parallel counters in multiplication (L. Dadda, On Parallel Digital Multipliers, Alta Freq 45: 574-580 (1976)).

[0003] A full adder is a special parallel counter with a three-bit input and a two-bit output. A current implementation of higher parallel counters i.e. with a bigger number of inputs is based on using full adders (C. C. Foster and F. D. Stockton, Counting Responders in an Associative Memory, IEEE Trans. Comput. C-20: 1580 1583 (1971)). In general, the least significant bit of an output is the fastest bit to produce in such implementation while other bits are usually slower.

[0004] The following notation is used for logical operations:

[0005] ⊕- Exclusive OR;

[0006]

-OR;

[0007]

- AND;

[0008]

-NOT.

[0009] An efficient prior art design (Foster and Stockton) of a parallel counter uses full adders. A full adder, denoted FA, is a three-bit input parallel counter shown in FIG. 1. It has three inputs X₁, X₂, X₃, and two outputs S and C. Logical expressions for outputs are

S=X₁⊕X₂⊕X₃,

C=(X ₁

X ₂)

(X ₁

X ₃)

(X ₂

X ₃).

[0010] A half adder, denoted HA, is a two bit input parallel counter shown in FIG. 1. It has two inputs X₁, X₂ and two outputs S and C. Logical expressions for outputs are

S=X₁⊕X₂,

C=X₁

X₂.

[0011] A prior art implementation of a seven-bit input parallel counter illustrated in FIG. 2.

[0012] Multiplication is a fundamental operation. Given two n-digit binary numbers

A_(n−1)2^(n−1)+A_(n−2)2^(n−2)+. . .+A₁ 2+A ₀ and B_(n−1)2^(n−1)+B_(n−2)2^(n−2)+. . . +B₁ 2+B ₀.

[0013] their product

P_(2n−1)2^(2n−1)+P_(2n−2)2^(2n−2)+. . . +P₁ 2+P ₀

[0014] may have up to 2 n digits. Logical circuits generating all P_(i) as outputs generally follow the scheme in FIG. 14. Wallace has invented the first fast architecture for a multiplier, now called the Wallace-tree multiplier (Wallace, C. S., A Suggestion for a Fast Multiplier, IEEE Trans. Electron. Comput. EC-13: 14-17 (1964)). Dadda has investigated bit behaviour in a multiplier (L. Dadda, Some Schemes for Parallel Multipliers, Alta Freq 34: 349-356 (1965)). He has constructed a variety of multipliers and most multipliers follow Dadda's scheme.

[0015] Dadda's multiplier uses the scheme in on FIG. 22. If inputs have 8 bits then 64 parallel AND gates generate an array shown in FIG. 23. The AND gate sign

is omitted for clarity so that A_(i)

B_(j) becomes A_(i)B_(j). The rest of FIG. 23 illustrates array reduction that involves fill adders (FA) and half adders (HA). Bits from the same column are added by half adders or fill adders. Some groups of bits fed into a full adder are in rectangles. Some groups of bits fed into a half adder are in ovals. The result of array reduction is just two binary numbers to be added at the last step. One adds these two numbers by one of the fast addition schemes, for instance, conditiora adder or carry-look-ahead adder.

[0016] In accordance with the first aspect the present invention provides a parallel counter based on algebraic properties of symmetric functions. Each of the plurality of binary output bits is generated as a symmetric function of a plurality of binary input bits.

[0017] The symmetric functions comprise logically AND combining sets of one or more binary inputs and logically OR or exclusive OR logic combining the logically combined sets of binary inputs to generate a binary output. The OR and the exclusive OR symmetric functions are elementary symmetric functions and the generated output binary bit depends only on the number of high inputs among the input binary bits. For the OR symmetric function if the number of high inputs is mn, the output is high if and only if m ≧k, where k is the size of the sets of binary inputs. Similarly, the generated output binary bit using the exclusive OR symmetric function is high if and only if m≧k and the number of subsets of inputs of the set of high inputs is an odd number. In one embodiment the size of the sets can be selected. The i^(th) output bit can be generated using the symmetric function using exclusive OR logic by selecting the set sizes to be of size 2 ^(i), where i is an integer from 1 to N, N is the number of binary outputs. and i represents the significance of each binary output.

[0018] In one embodiment the sets of binary inputs used in the symmetric functions are each unique and they cover all possible combinations of binary inputs.

[0019] This embodiment reduces the amount of fan-out in the circuit and increases the amount of logic sharing. It thus makes parallel counters for a large binary number more practicable.

[0020] In another embodiment of the present invention, the logic and inputs of the parallel counter are divided in accordance with a bay tree. The logic circuit is divided into a plurality of logic units. Each logic unit is arranged to generate logic unit binary outputs as a symmetric function of the binary inputs to the logic unit The binary inputs are divided into inputs into the plurality of logic units, and the binary outputs of the plurality of outputs are generated using binary outputs of a plurality of the logic units.

[0021] In a preferred embodiment, each of the logic units is arranged to receive 2^(n) of the binary inputs, where n is an integer indicating the level of the logic units in the binary tree, the logic circuit has m logic units at each level, where m is a rounded up integer determined from (the number of binary inputs)/2^(n), logic units having a higher level in the binary tree comprise logic of logic units at lower levels in the binary trees and each logic unit is arranged to generate logic unit binary outputs as a symmetric function of the binary inputs to the logic unit.

[0022] In one embodiment, each logic unit at the first level is arranged to generate logic unit binary outputs as a smallest elementary symmetric function of the binary inputs to said logic circuit.

[0023] In one embodiment, each logic unit at the first level is arranged to generate logic unit binary outputs as a symmetric function of the binary inputs to the logic circuit using OR logic for combining the binary inputs.

[0024] In one embodiment, each logic unit at the first level is arranged to logically AND each of the binary inputs to the logic unit and to logically OR each of the binary inputs to the logic unit to generate the logic unit binary outputs.

[0025] In one embodiment, each logic unit at the first level is arranged to generate logic unit binary outputs as a symmetric function of the binary inputs to the logic circuit using exclusive OR logic for combining the binary inputs.

[0026] In one embodiment, each logic unit at the first level is arranged to logically AND each of the binary inputs to the logic unit and to logically exclusively OR each of the binary inputs to the logic unit to generate the logic unit binary outputs.

[0027] In one embodiment, elementary logic units are provided as the logic units at the first level for performing elementary symmetric functions, outputs from each of two primary elementary logic units receiving four logically adjacent binary inputs from said plurality of inputs are input to two secondary elementary logic units, an output from each of the secondary elementary logic units is input to a tertiary elementary logic unit, and the primary, secondary and tertiary elementary logic units form a secondary logic unit at a second level of the binary tree having a binary output comprising a binary output from each of the secondary elementary logic units and two binary outputs from the tertiary elementary logic unit.

[0028] In one embodiment, tertiary logic units at a third level of the binary tree each comprise two secondary logic units receiving eight logically adjacent binary inputs from the plurality of inputs, four elementary logic units receiving as inputs the outputs of the two secondary logic units, and further logic for generating binary outputs as a symmetric function of the binary inputs to the tertiary logic unit using the binary outputs of the four elementary logic units.

[0029] In one embodiment, quaternary logic units at a fourth level of the binary tree each comprise two tertiary logic units receiving sixteen logically adjacent binary inputs from the plurality of inputs, four elementary logic units receiving as inputs the outputs of the two tertiary logic units, and further logic for generating binary outputs as a symmetric function of the binary inputs to the quaternary logic unit using the binary outputs of the four elementary logic units.

[0030] In one embodiment, elementary logic units are provided as the logic units at the first level for perfoming the smallest elementary symmetric functions, and logic units for higher levels comprise logic units of lower levels.

[0031] In one embodiment, the logic units for higher levels above the second level comprise logic units of an immediately preceding level and elementary logic units.

[0032] In one embodiment, each logic unit at each level is arranged to generate logic unit binary outputs as a symmetric function of the binary inputs to the logic circuit using OR logic for combining the binary inputs.

[0033] In one embodiment, each logic unit at each level is arranged to generate logic unit binary outputs as a symmetric function of the binary inputs to the logic circuit using exclusive OR logic for combining the binary inputs.

[0034] In one embodiment of the present invention, each of the binary outputs can be generated using a symmetric function which uses exclusive OR logic. However, exclusive OR logic is not as fast as OR logic.

[0035] In accordance with another embodiment of the present invention at least one of the binary outputs is generated as a symmetric function of the binary inputs using OR logic for combining a variety of sets of one or more binary inputs. The logic is arranged to logically AND members of each set of binary inputs and logically OR the result of the AND operations.

[0036] Thus use of the symmetric function using OR logic is faster and can be used for generation of the most significant output bit. In such an embodiment the set size is set to be 2^(N−1), where N is the number of binary outputs and the N^(th) binary output is the most significant.

[0037] It is also possible to use the symmetric function using OR logic for less significant bits on the basis of the output value of a more significant bit. In such a case, a plurality of possible binary outputs for a binary output less significant than the N^(th) are generated as symmetric functions of the binary inputs using OR logic for combining a plurality of sets of one or more binary inputs, where N is the number of binary outputs. Selector logic is provided to select one of the possible binary outputs based on a more significant binary output value. The size of the sets used in such an arrangement for the (N−1)^(th) bit is preferably 2^(N−1)+2^(n−2) and 2^(N−2) respectively and one of the possible binary outputs is selected based on the N^(th) binary output value.

[0038] In one embodiment of the present invention the circuit is designed in a modular form. A plurality of subcircuit logic modules are designed, each for generating intermediate binary outputs as a symmetric function of some of the binary inputs. Logic is also provided in this embodiment for logically combining the intermediate binary outputs to generate a binary outputs.

[0039] Since OR logic is faster, in a preferred embodiment the subcircuit logic modules implement the symmetric functions using OR logic. In one embodiment the subcircuit modules can be used for generating some binary outputs and one or more logic modules can be provided for generating other binary outputs in which each logic module generates a binary output as a symmetric function of the binary inputs exclusive OR logic for combining a plurality of sets of one or more binary inputs.

[0040] Another aspect of the present invention provides a method of designing a logic circuit comprising: providing a library of logic module designs each for performing a small symmetric function; designing a logic circuit to perform a large symmetric function; identifying small symmetric functions which can perform said symmetric function; selecting logic modules from said library to perform said small symmetric functions; identifying a logic circuit in the selected logic circuit which performs a symmetric function and which can be used to perform another symmetric function; selecting the logic circuit corresponding to the identified symmetric function and using the selected logic circuit with inverters to perform said other symmetric function using the relationship between the symmetric functions:

OR _(—) n _(—) k(X ₁ . . . X _(n))=

OR _(—) n_( n+1−k)(

X ₁

. . .

X _(n))

[0041] where

denotes an inversion, n is the number of inputs, and k is the number of sets of inputs AND combined together.

[0042] Another aspect of the present invention provides a conditional parallel counter having m possible high inputs out of n inputs, where m<n, and n and m are integers, the counter comprising the parallel counter for counting inputs to generate p outputs for m inputs, wherein the number n of inputs to the counter is greater than 2^(P), where p is an integer.

[0043] Thus these aspects of the present invention provide a fast circuit that can be used in any architecture using parallel counters. The design is applicable to any type of technology from which the logic circuit is built.

[0044] The parallel counter in accordance with this aspect of the present invention is generally applicable and can be used in a multiplication circuit that is significantly faster than prior art implementations.

[0045] In accordance with another aspect of the present invention a technique for multiplying 2N bit binary numbers comprises an array generation step in which an array of logical combinations between the bits of the two binary numbers is generated which is of reduced size compared to the prior art.

[0046] In accordance with this aspect of the present invention, a logic circuit for multiplying 2N bit numbers comprises array generation logic for performing the logical AND operation between each bit in one binary bit and each bit in the other binary number to generate an array of logical AND combinations comprising an array of binary values, and for further logically combining logically adjacent values to reduce the maximum depth of the array to below N bits; array reduction logic for reducing the depth of the array to two binary numbers; and addition logic for adding the binary values of the two binary numbers.

[0047] When two binary numbers are multiplied together, as is conventional each bit A_(i) of the first binary number is logically AND combined with each bit B_(j) of the second number to generate the array which comprises a sequence of binary numbers represented by the logical AND combinations, A_(i) AND B_(j). The farther logical combinations are carried out by logically combining the combinations A₁ AND B_(N−2), A₁ AND B_(N−1), A₀ AND B_(N−2), and A₀ AND B_(N−1), when N is the number of bits in the binary numbers. In this way the size of the maximal column of numbers to be added together in the array is reduced.

[0048] More specifically the array generation logic is arranged to combine the combinations A₁ AND B_(n−2) and A₀ AND B_(n−1) using exclusive OR logic to replace these combinations and to combine A₁ AND B_(N−1) and A₀ AND B_(n−2) to replace the A₁ AND B_(n−1) combination.

[0049] In one embodiment of the present invention the array reduction logic can include at least one of: at least one full adder, at least one half adder, and at least one parallel counter. The or each parallel counter can comprise the parallel counter in accordance with the first aspects of the present invention.

[0050] This aspect of the present invention provides a reduction of the maximal column length in the array thereby reducing the number of steps required for array reduction. When the first aspect of the present invention is used in conjunction with the second aspect of the present invention, an even more efficient multiplication circuit is provided.

[0051] Embodiments of the present invention will now be described with reference to the accompanying drawings, in which:

[0052]FIG. 1 is a schematic diagram of a full adder and a half adder in accordance with the prior art,

[0053]FIG. 2 is a schematic diagram of a parallel counter using full adders in accordance with the prior art,

[0054]FIG. 3 is a schematic diagram illustrating the logic modules executing the symmetric functions for the generation of binary outputs and the multiplexor (selector) used for selecting outputs,

[0055]FIG. 4 is a diagram illustrating the logic for implementing the symmetric function OR_(—)3_(—)1 according to one embodiment of the present invention,

[0056]FIG. 5 is a diagram illustrating the logic for implementing the symmetric function OR_(—)4_(—)1 according to one embodiment of the present invention,

[0057]FIG. 6 is a diagram illustrating the logic for implementing the symmetric function OR_(—)5_(—)1 using 2 3 input OR gates according to one embodiment of the present invention,

[0058]FIG. 7 is a diagram illustrating the logic for implementing the symmetric function EXOR_(—)7_(—)1 using two input exclusive OR gates according to one embodiment of the present invention,

[0059]FIG. 8 is a diagram illustrating the logic for implementing the symmetric function OR_(—)3_(—)2 according to one embodiment of the present invention,

[0060]FIG. 9 is a diagram illustrating the logic for implementing the symmetric function EXOR_(—)5_(—)3 according to one embodiment of the present invention.

[0061]FIG. 10 is a diagram illustrating a parallel counter using the two types of symmetric functions and having seven inputs and three outputs according to one embodiment of the present invention,

[0062]FIG. 11 is a diagram illustrating splitting of the symmetric function OR_(—)7_(—)2 into sub modules to allow the reusing of smaller logic blocks according to one embodiment of the present invention,

[0063]FIG. 12 is a diagram of a parallel counter using the EXOR_(—)7_(—)1 symmetric function for the generation of the least significant output bit from all of the input bits, and smaller modules implementing symmetric functions using OR logic to generate the second and third output bits according to one embodiment of the present invention.

[0064]FIG. 13 is a another diagram of a parallel counter similar to that of FIG. 12 accept that the partitioning of the inputs is chosen differently to use different functional sub modules according to one embodiment of the present invention,

[0065]FIG. 14 is a diagram schematically illustrating the binary tree organisation of the logic in a parallel counter according to a second aspect of the invention,

[0066]FIG. 15 is a diagram illustrating the logic block (Block 1) for implementing the elementary symmetric functions OR_(—)2_(—)2 and OR_(—)2_(—)1 according to one embodiment of the present invention,

[0067]FIG. 16 is a diagram illustrating the logic block (Block 2) for implementing the secondary symmetric functions OR_(—)4_(—)4, OR_(—)4_(—)3, OR_(—)4_(—)2 and OR_(—)4_(—)1 according to one embodiment of the present invention,

[0068]FIG. 17 is a diagram illustrating the logic block (Block 3) for implementing the tertiary symmetric functions OR_(—)8_(—)8, OR_(—)8_(—)7, OR_(—)8_(—)6, OR_(—)8_(—)5, OR_(—)8_(—)4, OR_(—)8_(—)3, OR_(—)8_(—)2 and OR_(—)8_(—)1 according to one embodiment of the present invention,

[0069]FIG. 18 is a diagram illustrating the logic block (Block 4) for implementing the symmetric functions OR_(—)15_(—)12, OR_(—)15_(—)8 and OR_(—)15_(—)4 according to one embodiment of the present invention,

[0070]FIG. 19 is a diagram illustrating the logic block (Block 5) for implementing the elementary symmetric functions EXOR_(—)4_(—)2 and OR_(—)4_(—)1 according to one embodiment of the present invention,

[0071]FIG. 20 is a diagram illustrating the logic block (Block 6) for implementing the elementary symmetric functions EXOR_(—)15_(—)2 and OR_(—)15_(—)1 according to one embodiment of the present invention,

[0072]FIG. 21 is a diagram schematically illustrating a parallel counter using the logic blocks of FIGS. 15 to 20 according to one embodiment of the present invention,

[0073]FIG. 22 is a diagram of the steps used in the prior art for multiplication,

[0074]FIG. 23 is a schematic diagram of the process of FIG. 22 in more detail,

[0075]FIG. 24 is a diagram illustrating the properties of diagonal regions in the array,

[0076]FIG. 25 is a diagram illustrating array deformation in accordance with the embodiment of the present invention and the subsequent steps of array reduction and adding, and

[0077]FIG. 26 is a diagram of logic used in this embodiment for array generation.

[0078] The first aspect of the present invention will now be described.

[0079] The first aspect of the present invention relates to a parallel counter counting the number of high values in a binary number. The counter has i outputs and n inputs where i is determined as being the integer part of log₂ n plus 1

[0080] A mathematical basis for the first aspect of the present invention is a theory of symmetric functions. We denote by C^(n)k the number of distinct k element subsets of a set of n elements. We consider two functions EXOR_n_k and OR_n_k of n variables X₁, X₂, . . . X_(n) given by

EXOR _(—) n _(—) k(X _(i) , X ₂ , . . . X _(n))=⊕(X _(i1)

X _(i2)

. . .

X _(ik)),

OR _(—) n _(—) k(X _(i) , X ₂ , . . . X _(n))=

(X _(i1)

X _(i2)

. . .

X _(ik))

[0081] where (i1, i2, . . . ik) runs over all possible subsets of {X₁, X₂, . . . X_(n)} that contain precisely k elements. Blocks that produce such outputs are shown on FIG. 3.

[0082] The functions EXOR_n_k and OR_n_k are elementary symmetric functions. Their values depend only on the number of high inputs among X_(i), X₂, X₃, . . . X_(n). More precisely, if m is the number of high inputs among X₁, X₂, X₃,. . . then OR_n_k(X₁, X₂, . . . X_(n)) is high if and only if m≧k. Similarly, EXOR_n_k(X₁, X₂, . . . X_(n)) is high if and only if m≧k and C^(m) _(k) is odd.

[0083] Although EXOR_n_k and OR_n_k look similar, OR_n_c is much faster to produce since EXOR-gates are slower than OR-gates.

[0084] In the above representation n is the number of inputs and k is the size of the subset of inputs selected. Each set of k inputs is a unique set and the subsets comprise all possible subsets of the set of inputs. For example, the symmetric function OR_(—)3_(—)1 has three inputs X₁, X₂ and X₃ and the set size is 1. Thus the sets comprise X₁, X₂ and X₃. Each of these sets is then logically OR combined to generated the binary output. The logic for performing this function is illustrated in FIG. 4.

[0085]FIG. 5 illustrates the logic for performing the symmetric OR_(—)4_(—)1.

[0086] When the number of inputs become large, it may not be possible to use simple logic.

[0087]FIG. 6 illustrates the use of two OR gates for implementing the symmetric function OR_(—)5_(—)1.

[0088]FIG. 7 similarly illustrates the logic for performing EXOR_(—)7_(—)1. The sets comprise the inputs X₁, X₂, X₃, X₄, X₅,X₆, and X₇. These inputs are input into three levels of exclusive OR gates.

[0089] When k is greater than 1, the inputs in a subset must be logically AND combined. FIG. 8 illustrates logic for performing the symmetric function OR_(—)3_(—)2. The inputs X₁ and X₂ comprise the first set and are input to a first AND gate. The inputs X₁ and X₃ constitute a second set and are input to a second AND gate. The inputs X₂ and X₃ constitute a third set and are input to a third AND gate. The output of the AND gates are input to an OR gate to generate the output function.

[0090]FIG. 9 is a diagram illustrating the logic for performing the symmetric function EXOR_(—)5_(—)3. To perform this function the subsets of size 3 for the set of five inputs comprise ten sets and ten AND gates are required. The output of the AND gates are input to an exclusive OR gate to generate the function.

[0091] The specific logic to implement the symmetric functions will be technology dependent. Thus the logic can be designed in accordance with the technology to be used.

[0092] In accordance with a first embodiment of the present invention the parallel counter of each output is generated using a symmetric function using exclusive OR logic.

[0093] Let the parallel counter have n inputs X₁, . . . X_(n) and t+1 outputs S_(t), S_(t−1), . . . S⁰⁻ S₀ is the least significant bit and St is the most significant bit For all i from 0 to t,

S _(i) =EXOR _(—) n _(—)2^(i)(X _(i) , X ₂ , . . . X _(n)).

[0094] It can thus be seen that for a seven bit input i.e. n=7, i will have values of 0, 1 and 2. Thus to generate the output So the function will be EXOR_(—)7_(—)1, to generate the output S₁ the function will be EXOR_(—)7_(—)2 and to generate the output S₂ the function will be EXOR_(—)7_(—)4. Thus for the least significant bit the set size (k) is 1 for the second bit the set size is 2 and for the most significant bit the set size is 4. Clearly the logic required for the more significant bits becomes more complex and thus slower to implement.

[0095] Thus in accordance with a second embodiment of the present invention, the most significant output bit is generated using a symmetric function using OR logic.

[0096] This is more practical since OR_n_k functions are faster than EXOR_n_k functions. For the most significant output bit

S _(k) =OR _(—) n _(—)2^(t)(X ₁ , X ₂ , . . . X _(n)).

[0097] In particular, with a seven-bit input

S ₂ =OR _(—)7_(—)4(X ₁ , X ₂, X₃ , X ₄ , X ₅ , X ₆ , X ₇).

[0098] Thus in this second embodiment of the present invention the most significant bit is generated using symmetric functions using OR logic whereas the other bits are generated using symmetric functions which use exclusive OR logic.

[0099] A third embodiment will now be described in which intermediate bits are generated using symmetric functions using OR logic.

[0100] An arbitrary output bit can be expressed using OR_n_k functions if one knows bits that are more significant. For instance, the second most significant bit is given by

S _(t−1)=(S _(t)

OR _(—) n _(—)2^(t)+2^(t−1))

((

S _(t))

OR _(—) n _(—)2^(t−1)).

[0101] In particular, with a seven-bit input

S ₁=(S ₂

OR _(—)7_(—)6(X ₁ , X ₂ , X ₃ , X ₄ , X ₅ , X ₆ , X ₇))

((

S ₂)

OR _(—)7_(—)2(X ₁ , X ₂ , X ₃ , X ₄ , X ₅ , X ₆ , X ₇)).

[0102] A further reduction is

S ₁ =OR _(—)7_(—)6(X ₁ , X ₂ , X ₃ , X ₄ , X ₅ , X ₆ , X ₇)

((

S ₂)

OR _(—)7_(—)2(X ₁ , X ₂ , X ₃ , X ₄ , X ₅ , X ₆ , X ₇)).

[0103] A multiplexer MU, shown in FIG. 3, implements this logic. It has two inputs X₀, X₁, a control C, and an output Z determined by the formula

Z=(

C

X ₁)

((

C)

X ₀).

[0104] It is not practical to use either EXORn_k functions or OR_n_k functions exclusively. It is optimal to use OR_n_k functions for a few most significant bits and EXOR_n_k functions for the remaining bits. The fastest, in TSMC.25, parallel counter with 7 inputs is shown in FIG. 10.

[0105] Future technologies that have fast OR_(—)15_(—)8 blocks would allow building a parallel counter with 15 inputs. A formula for the third significant bit using OR_n_m functions is thus:

S _(t−2) (S _(t)

S _(t−1)

OR_n _(—)2² t+2^(t−2))

(S _(t)

(

S _(t−1))

OR _(—) n _(—)2^(t)+2^(t−2))

((

S _(t))

S _(t−1)

OR _(—) n ₂2^(t−1)+2²⁻²)

((

S _(t))

(

S _(t−1))

OR _(—) n _(—)2^(t−2)).

[0106] A fourth embodiment of the present invention will now be described which divides the logic block implementing the symmetric function into small blocks which can be reused.

[0107] An implementation of OR_(—)7_(—)2 is shown in FIG. 11. The 7 inputs are split into two groups: five inputs from X₁ to X₅ and two remaining inputs X₆ and X₇. Then the following identity is a basis for the implementation in FIG. 11.

OR _(—)7_(—)2(X ₁ , . . . X ₇)=OR_(—)5_(—)2(X ₁ , . . . ,X ₅)

(OR _(—)5_(—)1(X ₁ , . . . X ₅)

OR _(—)2_(—)1(X ₆ , X ₇))

OR _(—)2_(—)2(X ₆ , X ₇)

[0108] One can write similar formulas for OR_(—)7_(—)4 and OR_(—)7_(—)6. Indeed,

OR _(—)7_(—)4(X ₁ , . . . X ₇)=OR _(—)5_(—)4(X, ₁ , . . . X ₅)

(OR _(—)5_(—)3(X ₁ , . . . X ₅)

OR _(—)2_(—)1(X _(6+I, X) ₇))

(OR _(—)5_(—)2(X₁ , . . . , X ₅)

OR _(—)2_(—)2(X ₆ , X ₇)),

OR _(—)7_(—)6(X ₁ , . . . , X ₇)=(OR _(—)5_(—)5(X ₁ , . . . X ₅)

OR _(—)2_(—)1(X ₆ , X ₇))

(OR _(—)5_(—)4(X ₁ , . . . X ₅)

OR _(—)2_(—)2(X ₆ , X ₇)).

[0109] Thus, it is advantageous to split variables and reuse smaller OR_n_k functions in a parallel counter. For instances an implementation of a parallel counter based on partitioning seven inputs into groups of two and five is in FIG. 12

[0110] Similarly, one can partition seven inputs into groups of four and three. An implementation of the parallel counter based on this partition is in FIG. 13. One uses the following logic formulas in this implementation.

OR_(—)7_(—)2(X₁ , . . . , X ₇)=OR _(—)4_(—)2(X ₁ , X ₂ , X ₃ , X ₄)

(OR _(—)4_(—)1(X ₁ , X ₂ , X ₃ , X ₄)

OR _(—)3_(—)1(X ₅ , X ₆ , X ₇))

OR _(—)3_(—)2(X ₅ , X ₆ , X ₇),

OR _(—)7_(—)4(X ₁ , . . . , X ₇)=OR _(—)4_(—)4(X ₁ , X ₂ , X ₃ , X ₄)

(OR _(—)4_(—)3(X ₁ , X ₂ , X ₃ , X ₄)

OR _(—)3_(—)1(X ₅ , X ₆ , X ₇))

(OR _(—)4_(—)2(X ₁ , X ₂ , X ₃ , X ₄)

OR_(—)3_(—)2(X ₅ , X ₆ , X ₇))

(OR _(—)4_(—)1(X ₁ , X ₂ , X ₃ , X ₄)

OR _(—)3_(—)3(X ₅ , X ₆ , X ₇)),

OR _(—)7_(—)6(X ₁ , . . . , X ₇)=(OR _(—)4_(—)4(X ₁ , X ₂ , X ₃ , X ₄)

OR _(—)3_(—)2(X ₅ , X ₆ , X ₇))

(OR _(—)4_(—)3(X ₁ , X ₂ , X ₃ , X ₄)

OR _(—)3_(—)3(X ₅ , X ₆ , X ₇)).

[0111] One needs a method to choose between the implementations in FIGS. 12 and 13. Here is a pneumonic rule for making a choice. If one or two inputs arrive essentially later then one should use the implementation on FIG. 12 based on partition 7=5+2. Otherwise, the implementation on FIG. 13 based on partition 7=4+3 is probably optimal.

[0112] Parallel counters with 6, 5, and 4 inputs can be implemented according to the logic for the seven input parallel counter. Reducing the number of inputs decreases the area significantly and increases the speed slightly. It is advantageous to implement a six input parallel counter using partitions of 6, 3+3 or 4+2.

[0113] A preferred embodiment of the present invention will now be described with reference to FIGS. 14 to 21.

[0114] Although it is possible to implement any OR_n_k or EXOR_n_k function in two levels of logic, the fan-out of each input is very high and the fan-in of the OR gate is also very high. It is known that both high fan-out and high fan-in contribute significantly to the delay of the circuit. It is often required that more than one OR_n_k or EXOR_n_k function be computed from the same inputs. A two level implementation does not allow sharing of logic thus resulting in high area.

[0115] This embodiment of the present invention uses the binary tree splitting of the inputs and the logic to reduce fan-out and enable reuse of logic. FIG. 14 illustrates schematically the organisation of the logic, At a first level 8 elementary logic blocks 1 are used each having two of the binary inputs and providing 2 outputs. The elementary logic blocks 1 of the first level perform elementary symmetric functions. These can either be exclusive OR symmetric functions or OR symmetric functions. At the second level four secondary logic blocks 2 each use the logic of two elementary logic blocks 1 and hence have four inputs and four outputs. The secondary logic blocks 2 perform larger symmetric functions. At the third level two tertiary logic blocks 3 each use the logic of two secondary logic blocks 2 and hence have eight inputs and eight outputs. The tertiary logic blocks 3 perform larger symmetric functions. At the fourth level the parallel counter 4 uses the logic of two tertiary logic blocks 3 and hence has sixteen inputs and sixteen outputs.

[0116] As can be seen in FIG. 14, the binary tree arrangement of the logic enables the logic for performing smaller symmetric functions to be used for the parallel counter. Also the arrangement provides for significant logic sharing. This significantly reduces fan-out.

[0117] As will be described in more detail, it is also possible to provide further logic sharing by using the elementary symmetric function logic for combining outputs of previous logic blocks in the binary tree.

[0118] The functions OR_(—)16_(—)8, OR_(—)16_(—)4 and OR_16_12 are constructed from the set of inputs X₁, X₂. . . X₁₆. Although, the embodiment is described with OR_n_k functions the same construction applies to EXOR_n_k functions after replacing every OR gate by an EXOR gate.

[0119] The principles behind this embodiment of the invention will now be described. The function OR_(r+s)_t can be computed as the OR of the functions OR_r_k {circumflex over ( )}OR_s_t-k as t runs through 0,1,2 . . . k,

OR_( r=s)_t(X ₁ . . . X _(r+s))=

_(k=0) ^(t) [OR _(—) r _(—) k(X ₁ . . . X _(r)){circumflex over ( )}OR _(—) s_( t−k)X _(r=1) . . . X _(r=s))].

[0120] In an embodiment with 16 inputs at a first level the 16 inputs are divided into 8 subsets −{X ₁,X₂}, {X₃,X₄}, . . . ,{X,₁₅,X₁₆}, each subset containing two inputs. For each subset a logic block 1 that computes OR_(—)2_(—)1 and OR_(—)2_(—)2 is constructed. The 8 blocks form the first level of the tree. Since each input fans out into an OR gate and an AND gate we see that each input has a fan-out of two. Also the first layer is very regular consisting of 8 identical blocks. The logic block 1 for computing the symmetric functions OR_(—)2_(—)1 and OR_(—)2_(—)2 is illustrated in FIG. 15.

[0121] At a second level, 4 logic blocks 2 are formed by combining outputs from two adjacent logic blocks 1 at level one. These 4 blocks comprise the second layer of the tree Each block has as inputs the outputs of two adjacent blocks from level one. The inputs are combined to form the functions OR_(—)4_(—)1, OR_(—)4_(—)2, OR_(—)4_(—)3, OR_(—)4_(—)4. The logic block 2 for computing these symmetric functions is illustrated in FIG. 16. The indices 1 and 2 are used in the equations below to distinguish functions formed on different subsets of the set of inputs. The symmetric functions can be represented as:

OR _(—)4_(—)1=[OR_(—)2_(—)1]₁

[OR _(—)2_(—)1]₂,

OR _(—)4_(—)2=([OR_(—)2_(—)1]₁{circumflex over ( )}[OR _(—)2_(—)1]₂)

([OR _(—)2_(—)2)₁ +[OR _(—)2_(—)2]₂),

OR _(—)4_(—)3=([OR_(—)2_(—)1]₁{circumflex over ( )}]OR _(—)2_(—)2]₂)

([OR _(—)2_(—)2]₁{circumflex over ( )}[OR _(‘)2_(—)1]₂),

OR _(—)4_(—)4=[OR _(—)2_(—)2]₁{circumflex over ( )}[OR _(—)2_(—)2]₂.

[0122] At a third level, 2 logic blocks 3 are formed by combining outputs from two adjacent logic blocks 2 at level two. These 2 blocks comprise the third layer of the tree. Each block has as inputs the outputs of two adjacent blocks from level two. The inputs are combined to form the functions OR_(—)8_(—)1, OR_(—)8_(—)2, OR_(—)8_(—)3, OR_(—)8_(—)4, OR_(—)8_(—)5, OR_(—)8_(—)6, OR_(—)8_(—)7 and OR_(—)8_(—)8. The logic block 3 for computing these symmetric functions is illustrated in FIG. 17. The symmetric functions can be represented as:

OR _(—)8_(—)1=(OR _(—)4_(—)1]₁

[OR _(—)4_(—)1]₂,

OR _(—)8_(—)2=([OR _(—)4_(—)1]₁{circumflex over ( )}[OR _(—)4_(—)1]₂)

[OR _(—)4_(—)2]

1

[ OR _(—)4_(—)2]₂,

OR _(—)8_(—)3=([OR _(—)4_(—)1[₁{circumflex over ( )}[OR _(—)4_(—)2]₂)

([OR _(—)4_(—)2]₁{circumflex over ( )}[OR _(—)4_(—)1]₂)

[OR _(—)4_(—)3]₁

[OR _(—)4_(—)3]₂,

OR _(—)8_(—)4=([OR _(—)4_(—)1]₁{circumflex over ( )}[OR _(—)4_(—)3]₂)

([OR _(—)4_(—)2]₁{circumflex over ( )}[OR _(—)4_(—)2]₂)

([OR _(—)4_(—)3]₁{circumflex over ( )}[OR _(—)4_(—)1]₂)

[OR _(—)4_(—)4]₁

[OR _(—)4_(—)4]₂,

OR _(—)8_(—)5=([OR _(—)4_(—)1]₁{circumflex over ( )}[OR _(—)4_(—)4]₂)

([OR _(—)4_(—)2]₁{circumflex over ( )}[OR _(—)4_(—)3]₂)

([OR _(—)4_(—)3)₁{circumflex over ( )}[OR _(—)4_(—)2]₂)

([OR _(—)4_(—)4]₁{circumflex over ( )}[OR _(—)4_(—)1]₂),

OR _(—)8_(—)6=([OR _(—)4_(—)2]₁{circumflex over ( )}[OR _(—)4_(—)4]₂)

([OR _(—)4_(—)3]₁{circumflex over ( )}[OR _(—)4_(—)3]₂)

([OR _(—)4_(—)4]₁{circumflex over ( )}[OR _(—)4_(—)2]₂),

OR _(—)8_(—)7=([OR _(—)4_(—)3]₁{circumflex over ( )}[OR _(—)4_(—)4]₂)

([OR _(—)4_(—)4]₁{circumflex over ( )}[OR _(—)4_(—)3]₂),

OR _(—)8_(—)8=[OR _(—)4_(—)4]₁{circumflex over ( )}[OR _(—)4_(—)4]₂.

[0123] At the final level, 3 outputs are formed by combining outputs from the two adjacent logic blocks 3 at level 3. This logic comprises the third layer of the tree. Outputs of the two adjacent blocks from level three are combined to form the functions OR_(—)6_(—)8, OR_(—)16_(—)4, and OR_(—)16_(—)12. The logic block 4 for computing these symmetric functions is illustrated in FIG. 18. The symmetric functions can be represented as:

OR _(—)16_(—)4 =([OR _(—)8_(—)1]₁{circumflex over ( )}]OR _(—)8_(—)3]₂)

([OR _(—)8_(—2]) ₁{circumflex over ( )}[OR _(—)8_(—)2]₂)

([OR _(—)8_(—)3]₁{circumflex over ( )}[OR _(—)8_(—)1]₂)

[OR _(—)8_(—)4]₁

[OR _(—)8_(—)4]₂,

OR _(—)16_(—)8=([OR _(—)8_(—)1]₁{circumflex over ( )}[OR _(—)8_(—)7]₂)

([OR _(—)8_(—)2]₁{circumflex over ( )}[OR _(—)8_(—)6]₂)

([OR _(—)8_(—)3]₁{circumflex over ( )}[OR _(—)8_(—)5]₂)

([OR_(—)8_(—)4]₁{circumflex over ( )}[OR _(—)8_(—)4]₂)

([OR _(—)8_(—)5]₁{circumflex over ( )}[OR _(—)8_(—)3]₂)

([OR _(—)8_(—)6]₁{circumflex over ( )}[OR _(—)8_(—)2]₂)

([OR _(—)8_(—)7]₁{circumflex over ( )}[OR _(—)8_(—)1₂)

[OR _(—)8_(—)8]₁

[OR _(—)8_(—)8]₂,

OR _(—)16_(—)12=([OR_(—)8_(—)4]₁{circumflex over ( )}([OR_(—)8_(—)8]₂)

([OR _(—)8_(—)5]₁{circumflex over ( )}[OR _(—)8_(—)7]₂)

((OR _(—)8_(—)6]₁{circumflex over ( )}[OR _(—)8_(—)6]₂)

([OR _(—)8_(—)7]_(t){circumflex over ( )}[OR _(—)8_(—)5]₂)

([OR _(—)8_(—)8]₁{circumflex over ( )}[OR _(—)8_(—)4]₂).

[0124] Whilst it is possible in accordance with the invention to generate all of the outputs of the parallel counter using the outputs of the logic blocks 3, it is advantageous to determine the two least significant bits separately in parallel. This is illustrated in FIGS. 19 and 20. Although this increases fan-out slightly, it decreases the depth of the tree thus increases the speed of the circuit.

[0125]FIG. 19 is a diagram of a logic block 5 for determining the symmetric functions EXOR_(—)4_(—)2 and EXOR_(—)4_(—)1. In the determination of EXOR_(—)4_(—)2 the faster OR gate replaces an EXOR gate, according to:

EXOR _(—)4_(—)2=([OR _(—)2_(—)1]₁{circumflex over ( )}[OR _(—)2_(—)1]₂)⊕[OR _(—)2_(—)2]₁⊕[OR _(—)2_(—)2]₂==([OR _(—)2_(—)1]₁{circumflex over ( )}[OR _(—)2_(—)1]₂)

([OR _(—)2_(—)2]₁⊕[OR _(—)2_(—)2]₂).

[0126] Four of these logic blocks 5 are provided to take the 16 inputs. Thus the logic block 5 can be considered to be a combined level 1 and 2 implementation.

[0127]FIG. 20 is a diagram of a logic block 6 for determining the symmetric functions EXOR_(—)15_(—)2 and EXOR_(—)15_(—)1 which comprise the least two significant bits output from the parallel counter of this embodiment. This logic block comprises level 3 in the binary tree and it uses four of the logic blocks 5. Thus even in this parallel determination of the least significant two bits, there is reuse of logic using the binary tree structure.

[0128]FIG. 21 is a diagram of the parallel converter of this embodiment of the invention in which the logic of block 4 is used to determine the most significant bits and the logic of block 6 is used to determine the least significant bits.

[0129] In the logic blocks illustrated in FIGS. 16, 17 and 18, it can be seen that in addition to sharing logic for the inputs the outputs of the elementary logic blocks the secondary logic blocks and the tertiary logic blocks are input into elementary logic blocks thus providing further logic sharing. The reason for this is that OR functions are not independent. Assuming that k≧s,

OR _(—) n _(—)

k

OR _(—) n _(—) s=OR _(—) n _(—) k,

OR _(—) n _(—)

k

OR _(—) n _(—) s=OR _(—) n _(—) s.

[0130] These formulas result in significant reductions in logic for parallel counter. The first instance of such a reduction is the following formula for the second most significant bit of a parallel counter,

S _(t−1) =OR _(—) n_(2^(t)+2^(t−1))

[

OR _(—) n _(—)2^(t)

OR _(—) n _(—)2^(t−1)].

[0131] To show the second instance of such a reduction, it is assumed that k≧s,

([OR _(—) n _(—) k] ₁

[OR _(—) m _(—) s] ₂)

([OR _(—) m _(—) s] ₁

[OR _(—) n _(—) k] ₂)=[OR _(—) m _(—) s] ₁

[OR _(—) m _(—) s] ₂

([OR _(—) n _(—) k] ₁

[OR _(—) n _(—) k] ₂).

[0132] These formulas allow the reduction of fan-out by sharing certain logic. As shown on block 2, the functions OR_(—)4_(—)2 and OR_(—)4_(—)3 are implemented by three levels of shared logic,

OR _(—)4_(—)1=[OR _(—)2_(—)1]₁

[OR _(—)2_(—)1]₂,

OR _(—)4_(—)2=([OR _(—)2_(—)1]₃

[OR _(—)2_(—)1]₂)

[OR _(—)2_(—)2]₁

[OR _(—)2_(—)2]₂,

OR _(—)4_(—)3=[OR _(—)2_(—)1]₁

[OR _(—)2_(—)1]₂

(]OR _(—)2_(—)2]₁

[OR _(—)2_(—)2]₂),

OR _(—)4_(—)4=[OR _(—)2_(—)2₁{circumflex over ( )}[OR _(—)2_(—)2]₂.

[0133] Block 3 is a circuit implementing logic of level three. The reductions afford the following expressions for functions OR_(—)8_(—)1, OR_(—)8_(—)2, OR_(—)8_(—)3, OR_(—)8_(—)4, OR_(—)8_(—)5, OR_(—)8_(—)6, OR_(—)8_(—)7, and OR_(—)8_(—)8,

OR _(—)8_(—)1=[OR _(—)4_(—)1]₁

[OR _(—)4_(—)1]₂,

OR _(—)8_(—)2=([OR _(—)4_(—)1]₁{circumflex over ( )}[OR _(—)4_(—)1]₂)

([OR _(—)4_(—)2]₁

[OR _(—)4_(—)2]₂),

OR _(—)8_(—)3=[([OR _(—)4_(—)1]₁{circumflex over ( )}[OR _(—)4_(—)1]₂){circumflex over ( )}([OR _(—)4_(—)2]₁

[OR _(—)4_(—)2]₂)]

[OR _(—)4_(—)3]₁

[OR _(—)4_(—)3]₂,

OR _(—)8_(—)4=[([OR _(—)4_(—)1]₁{circumflex over ( )}[OR _(—)4_(—)1]₂){circumflex over ( )}([OR _(—)4_(—)3]₁

[OR _(—)4_(—)3]₂)]

([OR _(—)4_(—)2]₁{circumflex over ( )}[OR _(—)4_(—)2]₂)

[OR _(—)4_(—)4]₁

[OR _(—)4_(—)4]₂,

OR _(—)8_(—)5=[([OR _(—)4_(—)1]₁{circumflex over ( )}[OR _(—)4_(—)1]₂){circumflex over ( )}([OR _(—)4_(—)4]₁

[OR _(—)4_(—)4]₂)]

[([OR _(—)4_(—)2]₁{circumflex over ( )}[OR _(—)4_(—)2]₂){circumflex over ( )}([OR _(—)4_(—)3]₁

[OR _(—)4_(—)3]₂)],

OR _(—)8_(—)6=[([OR _(—)4_(—)2]₁{circumflex over ( )}[OR _(—)4_(—)2]₂) {circumflex over ( )}([OR _(—)4_(—)4]₁

[OR _(—)4_(—)4]₂)]

([OR _(—)4_(—)3]₁{circumflex over ( )}[OR _(—)4_(—)3]₂),

OR_(—)8_(—)7=([OR _(—)4_(—)3]₁{circumflex over ( )}[OR _(—)4_(—)3]₂){circumflex over ( )}([OR _(—)4_(—)4]₁

[OR _(—)4_(—)4]₂),

OR _(—)8_(—)8=[OR _(—)4_(—)4]₁{circumflex over ( )}[OR _(—)4_(—)4]₂.

[0134] Block 4 is a circuit implementing logic for level 4. The implementation of functions OR_(—)16_(—)8, OR_(—)16_(—)4, and OR_(—)16_(—)12 follows reduced formulas,

OR _(—)16_(—)4=[([OR _(—)8_(—)1]₁{circumflex over ( )}[OR _(—)8_(—)1]₂){circumflex over ( )}([OR _(—)8_(—)3]₁

[OR _(—)8_(—)3]₂)]

([OR _(—)8_(—)2]₁{circumflex over ( )}[OR _(—)8_(—)2]₂)

[OR _(—)8_(—)4]₁

[OR _(—)8_(—)4]₂,

OR _(—)16_(—)8=[([OR _(—)8_(—)1[₁{circumflex over ( )}[OR _(—)8_(—)1]₂){circumflex over ( )}([OR _(—)8_(—)7]₁

[OR _(—)8_(—)7]₂)]

[([OR _(—)8_(—)2]₁{circumflex over ( )}[OR _(—)8_(—)2]₂){circumflex over ( )}([OR_(—)8_(—)6]₁

[OR _(—)8_(—)6]₂)]

[([OR _(—)8_(—)3]₁{circumflex over ( )}[OR _(—)8_(—)3]₂){circumflex over ( )}([OR _(—)8_(—)5]₁

[OR _(—)8_(—)5]₂)]

([OR _(—)8_(—)4]₁{circumflex over ( )}[OR _(—)8_(—)4]₂)

[OR _(—)8_(—)8]₁

[OR _(—)8_(—)8]₂,

OR _(—)16_(—)12=[([OR _(—)8_(—)4]₁{circumflex over ( )}[OR _(—)8_(—)4]₂){circumflex over ( )}([OR _(—)8_(—)8]₁

[OR _(—)8_(—)8]₂)]

([OR _(—)8_(—)6]₁{circumflex over ( )}[OR _(—)8_(—)6]₂)

[([OR _(—)8_(—)5]₁{circumflex over ( )}[OR _(—)8_(—)5]₂){circumflex over ( )}([OR _(—)8_(—)7]₁

[OR _(—)8_(—)7]₂))].

[0135] The binary tree principle of this embodiment of the present invention can be implemented using either OR or EXOR symmetric functions. When using EXOR symmetric functions there is a reduction in logic which applies. Assume that k=Σ_(iεS)2^(i) where S is a set of natural numbers uniquely determined by k as a set of positions of ones in the binary representation of k. Then

EXOR _(—) n _(—) k= AND _(iεs) EXOR _(—) n _(—)2^(i).

[0136] Thus, designing a circuit computing EXOR_n_k, one gets away with computing only functions EXOR_n_(—)2^(i) on subsets and thus although EXOR logic is slower, there is less fan-out than when using OR logic.

[0137] As can be seen in FIG. 21 the most efficient circuit can comprise a mixture of OR and EXOR symmetric function logic circuits.

[0138] During the design of the parallel counter there is also a flier possibility to save logic. There is a useful formula,

OR _(—) n _(—) k(X ₁ . . . X _(n))=

OR _(—) n_( n+1−k)(

X ₁. . , X _(n)).

[0139] Thus if a library contains a fast module generating OR_(—)4_(—)3 then this module can be used with inverters to generate OR_(—)4_(—)2. The opposite observation holds as well: an OR_(—)4_(—)2 module enables the generation of OR_(—)4_(—)3.

[0140] Further reductions can be applied to logic for a parallel counter based on OR elementary symmetric functions. For instance, the third significant bit admits the expression

S _(t−2) =OR _(—) n_(2^(t)+2^(t−1)2^(t−2))

[

OR _(—) n_(2^(t)+2^(t−1))

OR _(—) n_(2^(t)+2^(t−2))]

[

OR _(—) n _(—)2²

OR _(—) n_(2^(t−1)+2^(t−2))]

[

OR _(—) n _(—) 2 ^(t−1)

OR _(—) n _(—)2^(t−2)].

[0141] Another important application of reductions is logic for a conditional parallel counter. A conditional parallel counter is a module with n inputs. Let Q be a subset of {0,1 . . . n). The subset determines a condition. The module produces the binary representation of the number of high inputs if this number of high inputs belongs to Q. If the number of high inputs does not belong to Q, the outputs can be any logical function. Such a module can replace a parallel counter if the number of high inputs is in Q.

[0142] A useful conditional parallel counter has Q={0,1 . . . m} for some m≦n. Logic for such a counter can be obtained from logic for a parallel counter with m inputs by replacing every OR_m_k with OR_n_k. For instance, if Q={0,1,2,3) then a conditional parallel counter has 2 outputs S₁, S₀ given by

S ₁₌ OR _(—) n _(—)2, S ₀ =EXOR _(—) n _(—)1.

[0143] Another instance of a conditional parallel counter has Q={0,1,2,3,4,5},

S ₂ =OR _(—) n _(—)4, S _(I)=

OR _(—) n _(—)4

OR _(—) n _(—)2, S ₀ =EXOR _(—) n _(—)1.

[0144] If the number of high inputs for one of these two counters does not belong to Q then the output is the binary representation of the greatest element of Q, i.e., 3=11 or 5=101.

[0145] An important application of conditional parallel counters is constant multipliers. A constant multiplier is a module whose inputs form binary representations of two numbers A, B, and outputs comprise the binary representation of the product A*B whenever A is a number that belongs to a set of allowed constants. Since constant multipliers are smaller and faster then multipliers, it is beneficial to use them whenever one can choose one multiplicand from the set of allowed constants. One can do it, for instance, designing a digital filter.

[0146] Another aspect of the present invention comprises a technique for multiplication and this will be described hereinafter.

[0147] Multiplication is a fundamental operation in digital circuits. Given two n-digit binary numbers

A_(n−1)2^(n−1) +A _(n−2)2^(n−2) +, . . . +A ₁2+A ₀ and B _(n−1)2^(n−t) +B _(n−2)2^(n−2) +. . . +B ₁2+B ₀,

[0148] their product

[0149]P _(2n−1)2^(2n−1) +P _(2n−2)2^(2n−2) +. . . +P ₁2+P ₀

[0150] has up to 2n digits. Logical circuits generating all P_(i) as outputs generally follow the scheme in FIG. 14. Wallace has invented the first fast architecture for a multiplier, now called the Wallace-tree multiplier (Wallace, C. S., A Suggestion for a Fast Multiplier, IEEs Trans. Electron. Comput. EC-13: 14-17 (1964)). Dadda has investigated bit behaviour in a multiplier (L. Daddy Some Schemes for Parallel Multipliers, Alta Freq 34: 349-356 (1965)). He has constructed a variety of multipliers and most multipliers follow Dadda's scheme.

[0151] Dadda's multiplier uses the scheme in on FIG. 22. If inputs have 8 bits then 64 parallel AND gates generate an array shown in FIG. 23. The AND gate sign

is omitted for clarity so that A_(i)

B_(j) becomes A_(i)B_(j). The rest of FIG. 23 illustrates array reduction that involves fill adders (FA) and half adders (HA) Bits from the same column are added by half adders or full adders. Some groups of bits fed into a full adder are in rectangles. Some groups of bits fed into a half adder are in ovals. The result of array reduction is just two binary numbers to be added at the last step. One adds these two numbers by one of fast addition schemes, for instance, conditional adder or carry-look-ahead adder.

[0152] This aspect of the present invention comprises two preferred steps: array deformation and array reduction using the parallel counter with the accordance with the first aspect of the present invention.

[0153] The process of array deformation will now be described.

[0154] Some parts of the multiplication array, formed by A_(i)B_(j) such as on FIG. 23, have interesting properties. One can write simple formulas for the sum of the bits in these parts. Examples of such special parts are on FIG. 24. In general, chose an integer k, and those A_(i)B_(j) in the array such that the absolute value of i-j-k is less or equal to 1 comprise a special part.

[0155] Let S₁ be the bits of the sum of all the bits of the form A_(i)B_(j) shown on FIG. 1 Then

S ₀ =A ₀

B ₀,

S ₁=(A ₁

B ₀)⊕(A ₀

B ₁),

S ₂=(A ₁

B ₁)⊕(A ₁

B ₁

A ₀

B ₀),

S _(2k+1)=(A _(k+1)

B _(k))⊕(A _(k)

B _(k+1))⊕(A _(k)

B _(k)

A _(k−1)

B _(k−1)) for all k>0,

S _(2k)=(A _(k)

B _(k))⊕(A _(k−1)

B _(k−1)

((A _(k+1)

B _(k+1))

(A _(k−1)

(A _(k−1)

B _(k−1)

(A _(k+1)

B _(k+1)))) for all k>1.

[0156] These formulas show that the logic for summing the chosen entries in the array does not get large. Whereas if random numbers were summed the logic for the (n+1)^(th) bit is larger than the logic for the n^(th) bit.

[0157] Using these formulas, one can generate a different array. The shape of array changes. This is why it is called array deformation. These formulas are important because one can speed up a multiplication circuit by generating an array of a particular shape.

[0158] The array in FIG. 25 is for an 8-bit multiplication. The AND gate sign

is omitted for clarity so that A_(i)

B_(j) becomes A_(i)B_(j). Array deformation logic generates X, Y, and Z:

X=( A ₁

B ₆)⊕(A ₀

B ₇),

Y=A ₁

B ₇

(A ₀

B ₆),

Z=A ₁

B ₇

A ₀

B ₆.

[0159] The advantage of this array over one in FIG. 23 is that the maximal number of bits in a column is smaller The array in FIG. 23 has a column with 8 bits. The array on FIG. 25 has 4 columns with 7 bits but none with 8 or more bits. The logic for the generation of X Y and Z is illustrated in FIG. 26. This logic can be used in parallel with the first two fill adders (illustrated in FIG. 2) in the array reduction step thus avoiding delays caused by additional logic.

[0160] Array reduction is illustrated in FIG. 25. The first step utilizes 1 half adder, 3 full adders, 1 parallel counter with 4 inputs, 2 parallel counters with 5 inputs, 1 parallel counter with 6 inputs, and 4 parallel counters with 7 inputs. The three parallel counters (in columns 7. 8, and 9) have an implementation based on 7=5+2 partition. The bits X, Y, and Z join the group of two in the partition. The counter in column 6 is implemented on 7=4+3 partition. The counter in column 5 is based onb 6=3+3 partition. The remaining counters should not be partitioned. The locations of full adders are indicated by ovals. The half adder is shown by a rectangle.

[0161] An adder for adding the final two binary numbers is designed based on arrival time of bits in two numbers. This gives a slight advantage but it is based on common knowledge, that is conditional adder and ripple-carry adder.

[0162] Although in this embodiment the addition of two 8 bit numbers has been illustrated, the invention is applicable to any N bit binary number addition. For example for 16 bit addition, the array reduction will reduce the middle column height from 16 to 15 thus allowing two seven bit full adders to be used for the first layer to generate two 3 bit outputs and the left over input can be used with the other two 3 outputs as an input to a further seven input full adder thus allowing the addition of the 16 bits in only two layers.

[0163] This aspect of the present invention can be used with the parallel counter of the first aspects of the present invention to provide a fast circuit.

[0164] The parallel counter of the first aspects of the present invention has other applications, other than used in the multiplier of one aspect of he present invention. It can be used in RSA and reduced area multipliers. Sometimes, it is practical to build just a fragment of the multiplier. This can happen when the array is too large, for instance in RSA algorithms where multiplicands may have more than more than 1000 bits. This fragment of a multiplier is then used repeatedly to reduce the array. In current implementations, it consists of a collection of fill adders. One can use 7 input parallel counters followed by fill adders instead.

[0165] A parallel counter can also be used in circuits for error correction codes. One can use a parallel counter to produce Hamming distance. This distance is useful in digital communication. In particular the Hamming distance has to be computed in certain types of decoders, for instance, the Viterbi decoder or majority-logic decoder.

[0166] Given two binary messages (A₁, A₂, . . . A_(n)) and (B₁, B₂, . . . B_(n)), the Hamming distance between them is the number of indices i between I and n such that A_(i) and B_(i) are different. This distance can be computed by a parallel counter whose n inputs are

(A ₁ ⊕B ₁ , A ₂ ⊕B ₂ , . . . A _(n) ⊕B _(n)).

[0167] The multiply-and-add operation is fundamental in digital electronics because it includes filtering. Given 2n binary numbers X₁, X₂, . . . X_(n), Y₁, Y₂, . . . Y_(n), the result of this operation is

X _(i) Y ₁ +X ₂ Y ₂ +. . . +X _(n) Y _(n).

[0168] One can use the multiplier described to implement multiply-and-add in hardware. Another strategy can be to use the scheme in FIG. 22. All partial products in products X_(i)Y_(i) generate an array. Then one uses the parallel counter X to reduce the array.

[0169] In the present invention, one can use the parallel counter whenever there is a need to add an array of numbers. For instance, multiplying negative number in two-complement form, one generates a different array by either Booth recording (A. D. Booth, A Signed Binary Multiplication Technique, Q. J. Mech. Appl. Math, 4: 236-240 (1951)) or another method. To obtain a product one adds this array of numbers. 

1. A parallel counter comprising; a plurality of inputs for receiving a binary number as a plurality of binary inputs; a plurality of outputs for outputting binary code indicating the number of binary ones in the plurality of binary inputs; and a logic circuit connected between the plurality of inputs and the plurality of outputs and for generating each of the plurality of binary outputs as a symmetric function of the binary inputs; wherein said logic circuit is divided into a plurality of logic units, each logic unit is arranged to generate logic unit binary outputs as a symmetric function of the binary inputs to the logic unit, the binary inputs of said plurality of inputs are divided into inputs into a plurality of said logic units, and the binary outputs of said plurality of outputs are generated using binary outputs of a plurality of said logic units.
 2. A parallel counter according to claim 1, wherein the binary inputs of said plurality of inputs are divided according to a binary tree into inputs into a plurality of said logic units.
 3. A parallel counter according to claim 1, wherein said logic units are arranged to receive 2 ^(n) of said binary inputs, where n is an integer indicating the level of the logic units in the binary tree, said logic circuit has m logic units at each level, where m is a rounded up integer determined from (the number of binary inputs)/2^(n), logic units having a higher level in the binary tree comprise logic of logic units at lower levels in the binary tree, and each logic unit is arranged to generate logic unit binary outputs as a symmetric function of the binary inputs to the logic unit.
 4. A parallel counter according to claim 3, wherein each logic unit at the first level is arranged to generate logic unit binary outputs as an elementary symmetric function of the binary inputs to said logic circuit.
 5. A parallel counter according to claim 4, wherein each logic unit at the first level is arranged to generate logic unit binary outputs as a symmetric function of the binary inputs to said logic circuit using OR logic for combining the binary inputs.
 6. A parallel counter according to claim 5 wherein each logic unit at the first level is ranged to logically AND each of the binary inputs to the logic unit and to logically OR each of the binary inputs to the logic unit to generate the logic unit binary outputs.
 7. A parallel counter according to claim 4, wherein each logic unit at the first level is arranged to generate logic unit binary outputs as a symmetric function of the binary inputs to said logic circuit using exclusive OR logic for combining the binary inputs.
 8. A parallel counter according to claim 7 wherein each logic unit at the first level is arranged to logically AND each of the binary inputs to the logic unit and to logically exclusively OR each of the binary inputs to the logic unit to generate the logic unit binary outputs.
 9. A parallel counter according to claim 3 wherein elementary logic units are provided as the logic units at the first level for performing elementary symmetric functions, outputs from each of two primary elementary logic units receiving four logically adjacent binary inputs from said plurality of inputs are input to two secondary elementary logic units, an output from each of the secondary elementary logic units is input to a tertiary elementary logic unit, and said primary, secondary and tertiary elementary logic units form a secondary logic unit at a second level of the binary tree having a binary output comprising a binary output from each of said secondary elementary logic units and two binary outputs from said tertiary elementary logic unit.
 10. A parallel counter according to claim 9, wherein tertiary logic units at a third level of the binary tree each comprise two secondary logic units receiving eight logically adjacent b y inputs from said plurality of inputs, four elementary logic units receiving as inputs the outputs of said two secondary logic units, and further logic for generating binary outputs as a symmetric fiction of the binary inputs to said tertiary logic unit using the binary outputs of said four elementary logic units.
 11. A parallel counter according to claim 10, wherein quaternary logic units at a fourth level of the binary tree each comprise two tertiary logic units receiving sixteen logically adjacent binary inputs from said plurality of inputs, four elementary logic units receiving as inputs the outputs of said two tertiary logic units, and further logic for generating binary outputs as a symmetric function of the binary inputs to said quaternary logic unit using the binary outputs of said four elementary logic units
 12. A parallel counter according to claim 3, wherein elementary logic units are provided as the logic units at the first level for performing elementary symmetric functions, and logic units for higher levels are comprised of logic units of lower levels.
 13. A parallel counter according to claim 12, wherein said logic units for higher levels above the second level comprise logic units of an immediately preceding level and elementary logic units.
 14. A parallel counter according to claim 3, wherein each logic unit at each level is arranged to generate logic unit binary outputs as a symmetric function of the binary inputs to said logic circuit using OR logic for combining the binary inputs.
 15. A parallel counter according to claim 3, wherein each logic unit at each level is arranged to generate logic unit binary outputs as a symmetric function of the binary inputs to said logic circuit using exclusive OR logic for combining the binary inputs.
 16. A logic circuit for multiplying two binary numbers comprising: array generation logic for generating an array of binary numbers comprising all possible combinations of each bit of each binary number; array reduction logic including at least one parallel counter according to any preceding claim for reducing the number of combinations in the array; and binary addition logic for adding the reduced combinations to generate an output.
 17. A method of designing a logic circuit comprising: providing a library of logic module designs each for performing a small symmetric function; designing a logic circuit to perform a large symmetric function; identifying small symmetric functions which can perform said symmetric function; selecting logic modules from said library to perform said small symmetric functions; identifying a logic circuit in the selected logic circuit which performs a symmetric function and which can be used to perform another symmetric function; selecting the logic circuit corresponding to the identified symmetric function and using the selected logic circuit with inverters to perform said other symmetric function using the relationship between the symmetric functions: OR _(—) n _(—) k(X ₁ . . . X _(n))=

OR _(—) n_( n+1−k)(

X ₁

. . . .

X _(n)) where

denotes an inversion, n is the number of inputs, and k is the number of sets of inputs AND combined together.
 18. A conditional parallel counter having m possible high inputs out of n inputs, where m<n, and n and m are integers the counter comprising the parallel counter according to any one of claims 1 to 15 for counting inputs to generate p outputs for m inputs, wherein the number n of inputs to the counter is greater than 2^(P).
 19. A constant multiplier comprising a conditional parallel counter having m possible high inputs out of n inputs,where m<n, and n and m are integers the counter comprising the parallel counter according to any one of claims 1 to 15 for counting inputs to generate p outputs for m inputs, wherein the number n of inputs to the counter is greater than 2^(P).
 20. A digital filter comprising a conditional parallel counter having m possible high inputs out of n inputs, where m<n, and n and m are integers, the counter comprising the parallel counter according to any one of claims 1 to 15 for counting inputs to generate p outputs for m inputs, wherein the number n of inputs to the counter is greater than 2^(P).
 21. A parallel counter comprising: a plurality of inputs for receiving a binary number as a plurality of binary inputs; a plurality of outputs for outputting binary code indicating the number of binary ones in the plurality of binary inputs; and a logic circuit connected between the plurality of inputs and the plurality of outputs and for generating each of the plurality of binary outputs as a symmetric function of the binary inputs.
 22. A parallel counter according to claim 21 wherein said logic circuit is arranged to generate at least one of the binary outputs as a symmetric function of the binary inputs using exclusive OR logic for combining a plurality of sets of one or more binary inputs.
 23. A parallel counter according to claim 22 wherein said logic circuit is arranged to logically AND members of each set of binary inputs and to logically exclusively OR the result of the AND operations.
 24. A parallel counter according to claim 23 wherein said logic circuit is arranged to logically AND 2^(i) of the binary inputs in each set for the generation of the i^(th) binary output, where i is an integer from 1 to N, N is the number of binary outputs and i represents the significance of each binary output, each set being unique and the sets covering all possible combinations of binary inputs.
 25. A parallel counter according to claim 23 wherein said logic circuit is arranged to logically AND members of each set of binary inputs, where each set is unique and the sets cover all possible combinations of binary inputs.
 26. A parallel counter according to claim 21 wherein said logic circuit is arranged to generate at least one of the binary outputs as a symmetric function of the binary inputs using OR logic for combining a plurality of sets of one or more binary inputs.
 27. A parallel counter according to claim 26 wherein said logic circuit is arranged to logically AND members of each set of binary inputs and to logically OR the result of the AND operations.
 28. A parallel counter according to claim 27 wherein said logic circuit is arranged to logically AND 2^(N−1) of the binary inputs in each set for the generation of the N^(th) binary output, where N is the number of binary outputs and the N^(th) binary output is the most significant, each set being unique and the sets covering all possible combinations of binary inputs.
 29. A parallel counter according to claim 27 wherein said logic circuit is arranged to logically AND members of each set of binary inputs, where each set is unique and the sets cover all possible combinations of binary inputs.
 30. A parallel counter according to claim 21 wherein said logic circuit is arranged to generate a first binary output as a symmetric function of the binary inputs using exclusive OR logic for combining a plurality of sets of one or more binary inputs, and to generate an N^(th) binary output as a symmetric function of the binary inputs using OR logic for combining a plurality of sets of one or more binary inputs.
 31. A parallel counter according to claim 21 wherein said logic circuit is arranged to generate two possible binary outputs for a binary output less significant than the N^(th) binary output as symmetric functions of the binary inputs using OR logic for combining a plurality of sets of one or more binary inputs where N is the number of binary outputs, the sets used for each possible binary output being of two different sizes which are a function of the binary output being generated; and said logic circuit including selector logic to select one of the possible binary outputs based on a more significant binary output value.
 32. A parallel counter according to claim 31 wherein said logic circuit is arranged to generate the two possible binary outputs for the N−1)^(th) binary output less significant than the N^(th) binary output, as symmetric functions of the binary inputs using OR logic for combining a plurality of sets of one or more binary inputs the sets used for each possible binary output being of size +B2 ^(N−1)+2^(N−2) and 2^(N−2) respectively and said selector logic being arranged to select one of the possible binary outputs based on the N^(th) binary output value.
 33. A parallel counter according to claim 21 wherein said logic circuit includes a plurality of subcircuit logic modules each generating intermediate binary outputs as a symmetric function of some of the binary inputs, and logic for logically combining the intermediate binary outputs to generate said binary outputs.
 34. A parallel counter according to claim 33 wherein said subcircuit logic modules are arranged to use OR logic for combining sets of said some of said binary inputs.
 35. A parallel counter according to claim 34 wherein said logic circuit includes one or more logic modules each for generating a binary output as a symmetric function of the binary inputs using executive OR logic for combining a plurality of sets of one or more binary inputs. 36 A logic circuit for multiplying two N bit binary numbers the logic circuit comprising: array generation logic for performing the logical AND operation between each bit in one binary number and each bit in the other binary number to generate an array of logical AND combination comprising an array of binary values, and for further logically combining values to generate the array in which the maximal depth of the array is below N bits; array reduction logic for reducing the depth of the array to two binary numbers; and addition logic for adding the binary values of the two binary numbers.
 37. A logic circuit according to claim 36 wherein said array generation logic is arranged to perform the further logical combination of values for values formed by the logical AND combination of each bit A_(i) of one binary number and each bit B_(j) of the other binary number, where i-j-k <1, k is a chosen integer, and i and j are integers from 1 to N.
 38. A logic circuit according to claim 36 wherein said array generation logic is arranged to logically AND combine each bit A_(i) of the first binary number with each bit B_(j) of a second binary number to generate said array comprising a sequence of binary numbers represented by said logical AND combinations, A_(i) AND B_(j) and to carry out further logical combination by logically combining the combination A₁ AND B_(N−2), A₁ AND B_(N−)1 where N is the number of bits in the binary numbers.
 39. A logic circuit according to claim 38 wherein said array generation logic is arranged to combine the combinations A₁ AND B_(N−2) and A₀ AND B_(N−1) using exclusive OR logic to replace these combinations, and to combine A₁ AND B_(N−1) and A₀ AND B_(N−2) to replace the A₁ AND B_(N−1) combination.
 40. A logic circuit according to claim 36 wherein said array reduction logic includes at least one of: at least one fill adder, at least one half adder, and at least one parallel counter.
 41. A logic circuit according to claim 40 wherein said array reduction logic includes at least one parallel counter according to any one of claims 1 to 16 or 21 to
 35. 